<div class="relative">
    <table id="MarkTableSelect" data-url="{:request()->url()}"></table>
</div>
<script>
    $(function () {
        $('#MarkTableSelect').layTable({
            even: true, width: 'full', height: 'full', page: false,
            sort: {field: 'sort desc,id', type: 'asc'},
            cols: [[
                {checkbox: true, fixed: true, hide: true},
                {field: 'sort', hide: true},
                {field: 'name', title: '{:lang("标签名称")}', minWidth: 220,},
                {field: 'create_time', title: '{:lang("创建时间")}', width: 170, align: 'center'},
                {toolbar: '#SelectToolbar', title: '{:lang("操作面板")}', width: 160, align: 'center', fixed: 'right'},
            ]]
        }).trigger('tool', function (item) {
            let attr = ['{:lang("商品标签")}', item.data.id, item.data.name];
            window.setItemValue(item.data, attr.join('#'));
            $.msg.closeThisModal(this);
        });
    });
</script>

<!-- 操作工具条模板 -->
<script type="text/html" id="SelectToolbar">
    {{# if (typeof checkItemValue !== 'function' || checkItemValue(d.id)){ }}
    <a class="layui-btn layui-btn-sm" lay-event="select">{:lang('选 择')}</a>
    {{# }else{ }}
    <a class="layui-btn layui-btn-sm layui-btn-disabled">{:lang('已 选')}</a>
    {{# } }}
</script>
